phpservermon and Debian 9 (Stretch)

23 Jan

Let’s assume Proxmox:

apt-get install qemu-guest-agent openssh-server

Let’s prepare to install a newer version of PHP:

apt -y install lsb-release apt-transport-https ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php.list

Update the sources:

apt-get update

Now we can install:

apt-get install apache2 mysql-server libapache2-mod-php7.4 php7.4-common php7.4-curl php7.4-dev php7.4-gd php7.4-mbstring php7.4-xml php7.4-zip php7.4-mysql postfix

Let’s secure the database server:

mysql_secure_installation

Let’s create a database:

mysql -u root -p
CREATE USER 'phpmyadmin'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'%' WITH GRANT OPTION;
quit;

I prefer to have the site which runs phpMyAdmin is only accessible on another port:

nano /etc/apache2/ports.conf
Listen 8080

Create the directory the site source code will be located:

mkdir -p /var/vhosts/phpmyadmin/www

Download phpMyAdmin:

cd /tmp
wget https://files.phpmyadmin.net/phpMyAdmin/4.9.7/phpMyAdmin-4.9.7-english.tar.gz
tar xzf phpMyAdmin-4.9.7-english.tar.gz

We can then move it to the created folder:

cd phpMyAdmin-4.9.7-english
cp * -R /var/vhosts/phpmyadmin/www

Update Apache’s configuration:

nano /etc/apache2/sites-available/phpmyadmin.conf
<VirtualHost *:8080>
ServerName phpmyadmin
DocumentRoot "/var/vhosts/phpmyadmin/www"
<Directory />
Require all granted
</Directory>
</VirtualHost>

Assign proper permissions:

chown -R www-data:www-data /var/vhosts

Enable the site and restart the service:

a2ensite phpmyadmin
service apache2 restart

Create a user and database for phpservermon using phpMyAdmin.

http://ip-address:8080

Let’s create folders, download + extract, and move the source files for phpservermon:

mkdir -p /var/vhosts/website_name/www
mkdir -p /var/vhosts/website_name/ssl
cd /tmp
wget https://github.com/phpservermon/phpservermon/releases/download/v3.5.2/phpservermon-3.5.2.tar.gz
tar xzf phpservermon-3.5.2.tar.gz
cd phpservermon-3.5.2
cp * -R /var/vhosts/website_name/www

Update Apache’s server config:

nano /etc/apache2/sites-available/website_name.conf
<VirtualHost *:80>
ServerName website_name
Redirect / https://website_name/
</VirtualHost>
<VirtualHost *:443>
ServerName website_name
SSLEngine on
SSLCertificateFile /var/vhosts/website_name/ssl/certificate.crt
SSLCertificateKeyFile /var/vhosts/website_name/ssl/key.key
SSLCertificateChainFile /var/vhosts/website_name/ssl/ca-certificate.crt
DocumentRoot "/var/vhosts/website_name/www"
<Directory />
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

Create your certificate assets:

nano /var/vhosts/website_name/ssl/key.key
nano /var/vhosts/website_name/ssl/certificate.crt
nano /var/vhosts/website_name/ssl/ca-certificate.crt

Enable the new site and the required SSL module:

a2ensite website_name
a2enmod ssl

Assign the proper owner and restart the service:

chown -R www-data:www-data /var/vhosts
service apache2 restart

11 thoughts on “phpservermon and Debian 9 (Stretch)

  1. Need top-notch roof installation in Lancaster? Roof Installation Pros delivers professional services with a skilled team ready to handle all roof types. Their work is reliable, durable, and adds value to your home—trusted by many for timely and budget-friendly roofing solutions.

  2. Get reliable roof installation services in Lancaster with Roof Installation Pros. Whether it’s a new roof or a replacement, their experienced crew delivers quality craftsmanship that lasts. Known for fair pricing and dependable results that boost home value—your roof is in safe hands.

  3. For dependable and expert roof installation services in Lancaster, Roof Installation Pros is your go-to choice. They specialize in all roofing types, delivering lasting solutions that safeguard your property and boost its value. Count on them for affordable, high-quality, and on-time service.

  4. When it comes to roof installation in Lancaster, Roof Installation Pros stands out for quality and reliability. Their expert team works with all roof types, delivering strong, protective installations that add value. Highly rated for affordable, on-time, and professional roofing work.

  5. When it comes to roof installation in Lancaster, Roof Installation Pros stands out for quality and reliability. Their expert team works with all roof types, delivering strong, protective installations that add value. Highly rated for affordable, on-time, and professional roofing work.

  6. Get reliable roof installation services in Lancaster with Roof Installation Pros. Whether it’s a new roof or a replacement, their experienced crew delivers quality craftsmanship that lasts. Known for fair pricing and dependable results that boost home value—your roof is in safe hands.

  7. Searching for trusted roof installation in Lancaster? Roof Installation Pros provides expert services across all roofing styles. Their experienced team guarantees strong, lasting installations that enhance your home’s protection and market value. Excellent service, always on time and within budget.

Leave a Reply

Your email address will not be published.